namespace KPIS.GERP.Models.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class update0024 : DbMigration
    {
        public override void Up()
        {
            DropForeignKey("dbo.SysApprovePathDtl", "AppPrcId", "dbo.SysApproveProcess");
            DropForeignKey("dbo.SysApprovePathDtl", "AppPathId", "dbo.SysApprovePath");
            DropIndex("dbo.SysApprovePathDtl", new[] { "AppPrcId" });
            DropIndex("dbo.SysApprovePathDtl", new[] { "AppPathId" });
            AlterColumn("dbo.SysApprovePathDtl", "AppPathId", c => c.Int());
            AlterColumn("dbo.SysApprovePathDtl", "AppPrcId", c => c.Int());
            AddForeignKey("dbo.SysApprovePathDtl", "AppPrcId", "dbo.SysApproveProcess", "AppPrcId");
            AddForeignKey("dbo.SysApprovePathDtl", "AppPathId", "dbo.SysApprovePath", "AppPathId");
            CreateIndex("dbo.SysApprovePathDtl", "AppPrcId");
            CreateIndex("dbo.SysApprovePathDtl", "AppPathId");
        }
        
        public override void Down()
        {
            DropIndex("dbo.SysApprovePathDtl", new[] { "AppPathId" });
            DropIndex("dbo.SysApprovePathDtl", new[] { "AppPrcId" });
            DropForeignKey("dbo.SysApprovePathDtl", "AppPathId", "dbo.SysApprovePath");
            DropForeignKey("dbo.SysApprovePathDtl", "AppPrcId", "dbo.SysApproveProcess");
            AlterColumn("dbo.SysApprovePathDtl", "AppPrcId", c => c.Int(nullable: false));
            AlterColumn("dbo.SysApprovePathDtl", "AppPathId", c => c.Int(nullable: false));
            CreateIndex("dbo.SysApprovePathDtl", "AppPathId");
            CreateIndex("dbo.SysApprovePathDtl", "AppPrcId");
            AddForeignKey("dbo.SysApprovePathDtl", "AppPathId", "dbo.SysApprovePath", "AppPathId", cascadeDelete: true);
            AddForeignKey("dbo.SysApprovePathDtl", "AppPrcId", "dbo.SysApproveProcess", "AppPrcId", cascadeDelete: true);
        }
    }
}
